package com.syc.ext;

import com.baomidou.mybatisplus.generator.config.GlobalConfig;
import com.baomidou.mybatisplus.generator.config.converts.MySqlTypeConvert;
import com.baomidou.mybatisplus.generator.config.rules.DbColumnType;
import com.baomidou.mybatisplus.generator.config.rules.IColumnType;

/**
 * @author hhj
 * @description
 * @date 2024-08-25 23:03
 * @menu
 */
public class MySqlTypeConvertCustom extends MySqlTypeConvert {


    @Override
    public IColumnType processTypeConvert(GlobalConfig config, String fieldType) {
        String type = fieldType.toLowerCase();
        if(type.contains("tinyint(1)")){
            return DbColumnType.INTEGER;
        }
        return super.processTypeConvert(config, fieldType);
    }
}
